package com.zt.enums;

/**
 * 教师认证状态枚举
 */
public enum TeacherCertificationStatus {
    
    /**
     * 待认证
     */
    PENDING(1, "待认证"),
    
    /**
     * 已认证
     */
    APPROVED(2, "已认证"),
    
    /**
     * 未通过
     */
    REJECTED(3, "未通过");
    
    private final Integer code;
    private final String description;
    
    TeacherCertificationStatus(Integer code, String description) {
        this.code = code;
        this.description = description;
    }
    
    public Integer getCode() {
        return code;
    }
    
    public String getDescription() {
        return description;
    }
    
    /**
     * 根据状态码获取枚举
     */
    public static TeacherCertificationStatus getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (TeacherCertificationStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
    
    /**
     * 根据状态码获取描述
     */
    public static String getDescriptionByCode(Integer code) {
        TeacherCertificationStatus status = getByCode(code);
        return status != null ? status.getDescription() : "未知状态";
    }
}
